<template>
	<view class="container">
		<view class="user-info-box" v-if="userInfo">
			<view class="user-info-avatar">
				<image :src="userInfo.userAvatar"></image>
			</view>
			<view class="user-info">
				<view class="user-name">{{userInfo.userShortName}}</view>
				<view class="user-subject-code">
					<view class="user-subject">河南 {{userInfo.userSubjectShow}}</view>
					<view class="user-code">邀请码：{{userInfo.userInviteCode}}</view>
				</view>
			</view>
		</view>
		<view class="user-info-box" v-else>
			<view class="user-info-avatar">
				<image src="../../static/images/user_default.png"></image>
			</view>
			<view class="user-info">
				<view class="user-name">您还未登录</view>
				<view class="user-subject-code">
					<view class="user-subject">点击登录</view>
				</view>
			</view>
		</view>
		<view class="label-list">
			<view class="label-item" @tap="goStudentFavorite">
				<view class="label-icon">
					<image src="../../static/images/collection.png"></image>
				</view>
				<view class="label-name">我的收藏</view>
			</view>
			<view class="label-item" @tap="goStudentOrder">
				<view class="label-icon">
					<image src="../../static/images/order.png"></image>
				</view>
				<view class="label-name">我的订单</view>
			</view>
			<view class="label-item" @tap="goMyLabel">
				<view class="label-icon">
					<image src="../../static/images/label.png"></image>
				</view>
				<view class="label-name">我的标签</view>
			</view>
		</view>
		<view class="line"></view>
		<view class="list-box">
			<view class="list-item-box" @tap="goInputScore">
				<view class="list-item">
					<view class="item-left">
						<view class="item-icon">
							<image src="../../static/images/gkcj.png"></image>
						</view>
						<view class="item-label">高考成绩</view>
					</view>
					<view class="item-right">
						<image src="../../static/images/17x32.png"></image>
					</view>
				</view>
			</view>
			<view class="list-item-box" @tap="goStudentPayList">
				<view class="list-item">
					<view class="item-left">
						<view class="item-icon">
							<image src="../../static/images/kttq.png"></image>
						</view>
						<view class="item-label">开通特权</view>
					</view>
					<view class="item-right">
						<image src="../../static/images/17x32.png"></image>
					</view>
				</view>
			</view>
			<view class="list-item-box" @tap="goInviteFriends">
				<view class="list-item">
					<view class="item-left">
						<view class="item-icon">
							<image src="../../static/images/share.png"></image>
						</view>
						<view class="item-label">分享领特权</view>
					</view>
					<view class="item-right">
						<image src="../../static/images/17x32.png"></image>
					</view>
				</view>
			</view>
			<view class="list-item-box" @tap="goInputInviteCode">
				<view class="list-item">
					<view class="item-left">
						<view class="item-icon">
							<image src="../../static/images/txyqm.png"></image>
						</view>
						<view class="item-label">填写邀请码</view>
					</view>
					<view class="item-right">
						<image src="../../static/images/17x32.png"></image>
					</view>
				</view>
			</view>
			<view class="list-item-box" @tap="goModityPassword">
				<view class="list-item">
					<view class="item-left">
						<view class="item-icon">
							<image src="../../static/images/password.png"></image>
						</view>
						<view class="item-label">修改密码</view>
					</view>
					<view class="item-right">
						<image src="../../static/images/17x32.png"></image>
					</view>
				</view>
			</view>
			<view class="list-item-box" @tap="goSelectMode">
				<view class="list-item">
					<view class="item-left">
						<view class="item-icon">
							<image src="../../static/images/dqms.png"></image>
						</view>
						<view class="item-label">当前模式</view>
					</view>
					<view class="item-right">
						<view class="right-label">普招</view>
						<image src="../../static/images/17x32.png"></image>
					</view>
				</view>
			</view>
			<view class="list-item-box" @tap="contactService">
				<view class="list-item">
					<view class="item-left">
						<view class="item-icon">
							<image src="../../static/images/contact_service.png"></image>
						</view>
						<view class="item-label">联系客服</view>
					</view>
					<view class="item-right">
						<image src="../../static/images/17x32.png"></image>
					</view>
				</view>
			</view>
			<view class="list-item-box">
				<view class="list-item">
					<view class="item-left">
						<view class="item-icon">
							<image src="../../static/images/about.png"></image>
						</view>
						<view class="item-label">招办直联</view>
					</view>
					<view class="item-right">
						<image src="../../static/images/17x32.png"></image>
					</view>
				</view>
			</view>
		</view>
		<view class="logout-btn">退出登录</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userInfo: null,
				userTypeList: ['文科', '理科']
			}
		},
		
		onLoad() {
			this.userInfo = uni.getStorageSync('userInfo')
		},
		
		
		methods: {
			
			goSelectMode() {
				uni.navigateTo({
					url: '/pages/select_mode/select_mode'
				})
			},
			
			goStudentOrder() {
				uni.navigateTo({
					url: '/pages/student_order/student_order'
				})
			},
			
			goStudentFavorite() {
				uni.navigateTo({
					url: '/pages/student_favorite/student_favorite'
				})
			},
			
			contactService() {
				uni.makePhoneCall({
					phoneNumber: '18538525777'
				})
			},
			
			goInviteFriends() {
				uni.navigateTo({
					url: '/pages/invite_friends/invite_friends'
				})
			},
			
			goStudentPayList() {
				uni.navigateTo({
					url: '/pages/student_pay_list/student_pay_list'
				})
			},
			
			goModityPassword() {
				uni.navigateTo({
					url: '/pages/modify_password/modify_password'
				})
			},

			goMyLabel() {
				uni.navigateTo({
					url: '/pages/my_label/my_label'
				})
			},
			
			goInputScore() {
				uni.navigateTo({
					url: '/pages/input_score/input_score'
				})
			},
			
			goInputInviteCode() {
				uni.navigateTo({
					url: '/pages/input_invite_code/input_invite_code'
				})
			}

		}
	}
</script>

<style>
	.container {
		width: 750rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
	}
	
	.user-info-box {
		width: 670rpx;
		display: flex;
		flex-direction: row;
		margin-top: 30rpx;
	}
	
	.user-info-avatar image {
		width: 130rpx;
		height: 130rpx;
		border-radius: 50%;
	}
	
	.user-name {
		color: #333333;
		font-size: 36rpx;
	}
	
	.user-subject-code {
		width: 400rpx;
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		color: #999999;
		font-size: 24rpx;
		margin-top: 10rpx;
	}
	
	.user-info {
		margin-top: 20rpx;
		margin-left: 20rpx;
	}
	
	.label-list {
		width: 750rpx;
		display: flex;
		flex-direction: row;
		justify-content: space-evenly;
		margin-top: 46rpx;
	}
	
	.label-item {
		width: 200rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
	}
	
	.label-icon image {
		width: 54rpx;
		height: 54rpx;
	}
	
	.label-name {
		color: #333333;
		font-size: 30rpx;
	}
	
	.line {
		width: 750rpx;
		height: 6rpx;
		background-color: #f5f6fa;
		margin-top: 28rpx;
	}
	
	.list-box {
		width: 750rpx;
		padding-top: 30rpx;
	}
	
	.list-item-box {
		width: 100%;
		height: 100rpx;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}
	
	.list-item {
		width: 640rpx;
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
	}
	
	.item-left {
		width: 210rpx;
		display: flex;
		flex-direction: row;
		justify-content: flex-start;
		align-items: center;
	}
	
	.item-icon image {
		width: 40rpx;
		height: 40rpx;
	}
	
	.item-label {
		color: #333333;
		font-size: 30rpx;
		margin-bottom: 8rpx;
		margin-left: 10rpx;
	}
	
	.item-right {
		display: flex;
		flex-direction: row;
		justify-content: flex-end;
		align-items: center;
	}
	
	.right-label {
		margin-right: 20rpx;
		font-size: 30rpx;
		color: #666666;
	}
	
	.item-right image {
		width: 18rpx;
		height: 32rpx;
	}
	
	.logout-btn {
		width: 556rpx;
		height: 92rpx;
		background-color: #45d6b7;
		color: #ffffff;
		font-size: 36rpx;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		border-radius: 46rpx;
		margin-top: 40rpx;
		margin-bottom: 30rpx;
	}
</style>
